package com.jpa.sepcification.demo.test.service.mapper;

import com.jpa.sepcification.demo.test.domain.UserDO;
import com.jpa.sepcification.demo.test.service.dto.UserDTO;
import org.springframework.stereotype.Component;

/**
 * User mapper层
 *
 * @author zcj
 * @date 2020-12-28 13:34:38
 */
@Component
public class UserMapper {

	public UserDTO entityToDTO(UserDO user) {
		UserDTO userDTO = new UserDTO();
		userDTO.setId(user.getId());
		userDTO.setPassword(user.getPassword());
		userDTO.setUserName(user.getUserName());
		userDTO.setName(user.getName());
		userDTO.setAvatar(user.getAvatar());
		userDTO.setEmail(user.getEmail());
		userDTO.setPhone(user.getPhone());
		userDTO.setCreatedBy(user.getCreatedBy());
		userDTO.setCreatedDate(user.getCreatedDate());
		userDTO.setLastModifiedBy(user.getLastModifiedBy());
		userDTO.setLastModifiedDate(user.getLastModifiedDate());
		userDTO.setVersion(user.getVersion());
		return userDTO;
	}

}
